package com.jie.controller;

import com.jie.pojo.Student;
import com.jie.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/getAllStudent")
    @ResponseBody
    public List<Student> getUserById(HttpServletRequest request, String classid) throws Exception {

        List<Student> studentList = studentService.findAllStudent(classid);
        return studentList;
    }
}
